<?php
/* @var $this ProductStatsController */

$this->breadcrumbs=array(
	'综合控制台'=>array($this->pre_module_url.'/index/index'),
	'商城统计'=>array($this->pre_module_url.'/productStats/admin'),
	'浏览排行'=>array($this->pre_module_url.'/browseStats/admin'),
);
//行业分类
$category = Category::model()->findByPk($model->catgory_id);
?>
<div class="pro_filter c_f">
	<div class="filter f_l">
		<?php $form=$this->beginWidget('CActiveForm', array(
			'action'=>Yii::app()->createUrl($this->route),
			'id'=>'product-form',
			'method'=>'get',
			)); ?>
			<label>类目：</label>
			<span id="catagory" >
				<select name="Product[cateid1]" class="level_1 s_ipt w_120" id="dataProductIndustryId1" ></select>
				<select name="Product[cateid2]" class="level_2 s_ipt w_120" id="dataProductIndustryId2"></select>
				<select name="Product[cateid3]" class="level_3 s_ipt w_120" id="dataProductIndustryId3" ></select>
			</span>
			<?php echo $form->dropDownList($model,'search_type',Product::model()->getSearchType(),array('class'=>'s_ipt w_120'))?>
			<?php echo CHtml::textField('Product[search_content]',empty($model->search_content)?'请输入关键字':$model->search_content,array('class'=>'t_ipt w_170','onfocus'=>"if (value =='请输入关键字'){value =''}",'onblur'=>"if (value ==''){value='请输入关键字'}"))?>
			<?php echo CHtml::submitButton(Yii::t('adm','Search'),array('class'=>'mem_bgx mem_btn01')); ?>
			<?php $this->endWidget(); ?>
	</div>
</div>
<table class="list_table list_table2" cellpadding="0" cellspacing="0" width="100%">
	<tr>
		<th width="" class="pl15">宝贝信息</th>
		<th width="20%">店铺名称</th>
		<th width="15%">价格</th>
		<th width="15%">浏览量</th>
		<th width="18%">发布时间</th>
	</tr>
</table>

<?php     
$this->widget('zii.widgets.CListView', array(    
    'dataProvider'=>$model->search(),    
    'itemView'=>'_view',      
    'emptyText'=>'暂时没有数据',    
 //   'selectAll'=>array('ids[]','id[]'),    
    'itemsTagName'=>'table',  
    'itemsOptions'=>array('class'=>'list_table list_table2','width'=>'100%','cellpadding'=>0,'cellspacing'=>0),  
  /*  'artLink'=>array(    
        //首页推荐    
        array(Yii::t('cmp','Recommended home'),$this->pre_module_url.'/product/recommend','确认推荐选中产品到首页！'),    
        //取消推荐    
        array(Yii::t('cmp','un Recommended home'),$this->pre_module_url.'/product/uncommend','确认取消推荐选中产品！'),    
        //下架    
        array(Yii::t('cmp','downshelf'),$this->pre_module_url.'/product/downshelf','确认上架选中产品！'),    
    ), */   
    'batchItem'=>array(    
        //导出数据
        CHtml::linkbtn(Yii::t('adm','Export Data'),'javascript:',array('onclick'=>'exportData()')),      
    ),    
));    
?>  

<script type="text/javascript" src="/js/multi_select.js"></script>
<script type="text/javascript">
$.getJSON('/cache/GetCategory',function(json){
	var options	= {data	: json};
	var loc = new multi_select(options);
	loc.bind('#catagory .level_1','<?php if(!empty($category)) echo ($category->zca_topid>0)?$category->zca_topid:(($category->zca_parentid>0)?$category->zca_parentid:$category->zca_id)?>');
	loc.bind('#catagory .level_2','<?php if(!empty($category)) echo ($category->zca_topid>0)?$category->zca_parentid:(($category->zca_parentid>0)?$category->zca_id:'')?>');
	loc.bind('#catagory .level_3','<?php if(!empty($category)) echo ($category->zca_topid>0)?$category->zca_id:''?>');
});
//导出数据
function exportData(){
	$("#product-form").attr('action','export');
	$("#product-form").submit();
	$("#product-form").attr('action','');
};

</script>